import React from 'react';
import ReactDOM from 'react-dom';
import {BrowserRouter,Route,Switch} from 'react-router-dom'
import App from './App';
// UI（page + Router）- action - store(redux - react-redux - redux-thunk )  -request(fetch/axios) - api 
import {store,history} from './store'
import {Provider} from 'react-redux'
import {ConnectedRouter} from 'connected-react-router'

// const root = ReactDOM.createRoot(document.getElementById('root'));
// root.render(
//     <Provider store={store}>
//          <ConnectedRouter history={history}>
//             {/* 预留多个SPA 入口，方便项目 扩展 */}
//             <Switch>
//                 <Route path="/" component={App} />
//             </Switch>
//         </ConnectedRouter>
//     </Provider>
// );

ReactDOM.render((
    <Provider store={store}>
      <ConnectedRouter history={history}>
        <Switch>
          {/* 预留MPA 多个单页面入口 */}
          <Route path="/" component={App} /> 
        </Switch>
      </ConnectedRouter>
    </Provider>
  ), document.getElementById('root'));


